//
//  main.m
//  NSStringAndNSValue
//
//  Created by dllo on 16/7/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Book.h"
#import "BookManager.h"
int main(int argc, const char * argv[]) {
    
    
//    1.截取字符串 "20|https://www.baidu.com" 中 "|" 前面和后⾯的字符串, 并输出
//    2.向可变数组里存储 int、float、double、BOOL类型等数据(不能使用字面量)
//    3.实现图书管理系统(BookManager类)：
//    使用数组管理所有书籍(Book类)。
//    BookManager类属性数组可以添加、删除。
//    可以从数组根据书名查找书籍，并修改书籍的价格。
//    展示所有书籍清单（书名）
//    
    //1.
#if 0
    NSString *str = [[NSString alloc] initWithFormat:@"20|https://www.baidu.com"];
    NSArray *arr = [str componentsSeparatedByString:@"|"];
    NSLog(@"%@",arr);
#endif
    //2.
#if 0
    NSMutableArray *arr = [[NSMutableArray alloc] init];
    int a = 0;
    float b = 2.3;
    double c = 2.65655555;
    BOOL d = YES;
    
    NSNumber *number1 = [[NSNumber alloc] initWithInt:a];
    NSNumber *number2 = [[NSNumber alloc] initWithFloat:b];
    NSNumber *number3 = [[NSNumber alloc] initWithDouble:c];
    NSNumber *number4 = [[NSNumber alloc] initWithBool:d];
    [arr addObject:number1];
    [arr addObject:number2];
    [arr addObject:number3];
    [arr addObject:number4];
    NSLog(@"%@",arr);
#endif
    //3
#if 0
    Book *book1 = [Book bookWithName:@"shuihuzhuan" price:20];
    Book *book2 = [Book bookWithName:@"sanguo" price:12];
    Book *book3 = [Book bookWithName:@"xiakexing"price:60];
    
    
    BookManager *bookManager = [[BookManager alloc] init];
    [bookManager addBook:book1];
    [bookManager addBook:book2];
    [bookManager addBook:book3];
    [bookManager removeBook:book1];
    [bookManager list];
    
    [bookManager listBookName];
    
#endif


    
    
    
    return 0;
}
